import request from '@/utils/request'

// 获取表单提交列表
export function List(params) {
  return request({
    url: '/static_web/api/form-submissions/',
    method: 'get',
    params
  })
}

// 获取表单提交详情
export function Get(id) {
  return request({
    url: `/static_web/api/form-submissions/${id}/`,
    method: 'get'
  })
}

// 更新表单提交状态
export function Put(id, data) {
  return request({
    url: `/static_web/api/form-submissions/${id}/`,
    method: 'put',
    data
  })
}

// 删除表单提交
export function Delete(id) {
  return request({
    url: `/static_web/api/form-submissions/${id}/`,
    method: 'delete'
  })
}

// 获取统计数据
export function GetStats() {
  return request({
    url: '/static_web/api/form-submissions/stats/',
    method: 'get'
  })
}

// 批量更新状态
export function BatchUpdate(data) {
  return request({
    url: '/static_web/api/form-submissions/batch-update/',
    method: 'post',
    data
  })
}

// 导出数据
export function ExportData(params) {
  return request({
    url: '/static_web/api/form-submissions/export/',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
